body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    overflow: hidden;
    background-color: #0f1113;
    color: #d7d7d7;
}

.hidden { display: none !important; }

#map-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

svg {
    width: 100%;
    height: 100%;
    transition: background-color 1s ease;
}

.country {
    stroke: #2a2f36;
    stroke-width: 0px;
    vector-effect: non-scaling-stroke;
    transition: fill 0.5s ease, filter 0.5s ease;
    filter: none;
}

.country:hover {
    cursor: pointer;
    stroke-width: 1px;
    stroke: rgb(var(--accent));
    filter: none !important;
}

.country-0 { 
    fill: #6b7b85; 
}

.country-1 { 
    fill: #7c8b41; 
}

.country-2 { 
    fill: #c2a23a; 
}

.country-3 { 
    fill: #9b2d2d; 
    filter: drop-shadow(0 0 0px color)
}

.country-4 { 
    fill: #4a1a1a; 
}

.country-5 { 
    fill: #333333 !important;
    stroke: #555; 
    stroke-width: 0px
}

.country-6 { 
    fill: #000000; 
}

.screen-darkener {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.25), rgba(0,0,0,0.6));
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 50;
}

.tooltip {
    position: absolute;
    background: rgba(18, 20, 23, 0.95);
    color: #e2e2e2;
    padding: 10px;
    border-radius: 5px;
    pointer-events: none;
    font-size: 14px;  
    max-width: 250px;  
    word-wrap: break-word;  
    z-index: 1000;
    border: 1px solid #2a2f36;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(27,31,36,0.96);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    border: 1px solid #2a2f36;
}

.controls button {
    margin-bottom: 5px;
    padding: 5px 10px;
    cursor: pointer;
    border: 1px solid #3a3f46;
    background-color: #2a2f36;
    color: #d7d7d7;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.controls button:hover {
    background-color: #c6a15b;
    color: #111;
}

.controls button:active {
    background-color: #c6a15b;
    color: #111;
}

.alliance-toggle {
    margin-top: 10px;
    padding: 5px;
    background-color: #2a2f36;
    color: #d7d7d7;
    border: 1px solid #3a3f46;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.alliance-toggle:hover {
    background-color: #c6a15b;
    color: #111;
}

.speed-controls {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #2a2f36;
    text-align: right;
    font-size: 14px;
}

.speed-controls button {
    margin-left: 5px;
    margin-bottom: 0;
    padding: 3px 8px;
    font-size: 12px;
    background-color: #2a2f36;
    color: #d7d7d7;
    border: 1px solid #3a3f46;
}

.speed-controls button:hover {
    background-color: #c6a15b;
    color: #111;
}

.speed-controls button.active {
    background-color: #c6a15b;
    color: #111;
}

.global-stats {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(27,31,36,0.96);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 100;
    font-size: 14px;
    max-width: 300px;
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.date-display {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27,31,36,0.96);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 100;
    font-size: 18px;
    font-weight: bold;
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.date-display.collapsed #date-text { display: none; }

.news-panel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(27,31,36,0.96);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 100;
    width: 300px;
    max-height: 200px;
    overflow-y: auto;
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.stats-panel {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(27,31,36,0.96);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 100;
    width: 300px;
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.country-panel {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27,31,36,0.96);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 100;
    width: 300px;
    display: none;
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.country-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.country-modal-content {
    background-color: #14171a;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #2a2f36;
    width: 70%;
    max-width: 800px;
    border-radius: 5px;
    position: relative;
    color: #d7d7d7;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.country-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.country-stat-item {
    padding: 8px;
    background-color: rgba(27,31,36,0.9);
    border-radius: 5px;
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.country-stat-item strong {
    color: #ff4500;
    display: block;
    margin-bottom: 3px;
}

h2 {
    color: #c6a15b;
    border-bottom: 2px solid #3a3f46;
    padding-bottom: 10px;
}

h3 {
    margin-top: 0;
    margin-bottom: 5px;
}

button {
    margin: 2px;
    padding: 5px 10px;
    cursor: pointer;
}

.war-btn {
    background-color: #ff4500;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 10px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.war-btn:hover {
    background-color: #ff6347;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    background: rgba(27,31,36,0.95);
    padding: 20px;
    border-radius: 10px;
    z-index: 200;
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.news-item {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(198,161,91,0.25);
    color: #c9c9c9;
}

.pinned-news-item {
    background-color: rgba(198,161,91,0.12);
    border: 1px solid rgba(198,161,91,0.35);
    border-radius: 3px;
    padding: 8px;
    margin-bottom: 8px;
    color: #d3c29a;
    font-weight: bold;
    border-bottom: 1px solid rgba(198,161,91,0.35);
}

.pin-icon {
    margin-right: 5px;
    font-size: 14px;
}

.news-separator {
    margin: 10px 0;
    color: #999;
    font-size: 12px;
    text-align: center;
    opacity: 0.7;
}

.modal {
    display: none;
    position: fixed;
    z-index: 3001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #14171a;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #2a2f36;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    color: #d7d7d7;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.close {
    color: #ff4500;
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

@keyframes shockWave {
    0% { 
        transform: scale(0);
        opacity: 1;
    }
    100% { 
        transform: scale(1.5);
        opacity: 0;
    }
}

.shock-wave {
    animation: shockWave 2s ease-in-out;
    animation-fill-mode: forwards;
    stroke-width: 2px;
    stroke: #ff00ff;
    fill: none;
}

.soldier-circle {
    fill: #ff4444;
    stroke: #000;
    stroke-width: 1px;
}

.alliance-soldier {
    fill: #0088ff;
    stroke: #000;
    stroke-width: 1px;
}

.missile-soldier {
    fill: #ffff00;
    stroke: #000;
    stroke-width: 1px;
}

.missile-line {
    animation: none;
    stroke-opacity: 0.8;
    stroke-width: 5px !important; 
    stroke: #d6c26a;
}

.welcome-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333333;
}

.welcome-modal-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
}

.welcome-modal h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ff4500;
}

.welcome-modal h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ffd700;
}

.welcome-modal p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.welcome-features {
    background-color: rgba(240, 240, 240, 0.8);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.welcome-features h3 {
    color: #ff4500;
    margin-bottom: 15px;
}

.welcome-features ul {
    list-style-type: none;
    padding: 0;
    text-align: left;
}

.welcome-features ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.welcome-features ul li::before {
    content: '•';
    color: #ff4500;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

#start-game-btn {
    background-color: #ff4500;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#start-game-btn:hover {
    background-color: #ff6347;
}

.no-signal-text {
    fill: #ff4500;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 69, 0, 0.7);
}

.global-stats h3,
.news-panel h3,
.stats-panel h3 {
    color: #c6a15b;
    border-bottom: 2px solid #3a3f46;
}

.alliance-btn {
    background-color: #0088ff;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 10px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.alliance-btn:hover {
    background-color: #00aaff;
}

.alliances-section {
    margin-top: 15px;
    background-color: rgba(0, 136, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(0, 136, 255, 0.3);
}

.alliances-section h3 {
    color: #0088ff;
    border-bottom: 2px solid #0088ff;
    margin-top: 0;
}

.alliances-section ul {
    list-style-type: none;
    padding: 0 0 0 5px;
    margin: 5px 0 0 0;
}

.alliances-section li {
    margin-bottom: 5px;
    padding: 5px;
    background-color: rgba(240, 240, 240, 0.8);
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

#alliance-selection-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 136, 255, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 1000;
    animation: pulse 2s infinite;
}

.target-selection-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 69, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 0;
        stroke-width: 2px;
    }
    50% {
        stroke-width: 3px;
    }
    100% {
        stroke-dashoffset: 15;
        stroke-width: 2px;
    }
}

@keyframes dash-yellow {
    0% {
        stroke-dasharray: 0;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-width: 6;
    }
    100% {
        stroke-dasharray: 10, 5;
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

@keyframes misile-dash {
    0% { stroke-dasharray: 10, 5 }
    100% { stroke-dashoffset: 100 }
}

.attack-line {
    stroke-miterlimit: 10;
    stroke-width: 2px !important;
    stroke-opacity: 0.85 !important;
}

.attack-line[stroke="#00ff00"] { 
    animation: dash 5s linear infinite;
    stroke-width: 2px !important;
    stroke-opacity: 0.9 !important;
    stroke-dasharray: 10,5 !important;
    stroke: #4e8a5f !important;
}

.alliance-line {
    stroke-dasharray: none !important;  
    stroke-width: 2px;
    stroke-opacity: 0.7;
}

.ceasefire-line {
    stroke: #66ff00;
    stroke-width: 2.5px;
    stroke-dasharray: 6,6;
    opacity: 0.5;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(102,255,0,0.25));
}

.negotiation-line {
    stroke: #66ff00;
    stroke-width: 2.5px;
    stroke-dasharray: 4,5;
    opacity: 0.5;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(102,255,0,0.18));
}

.country-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.country-image.anarchy {
    filter: grayscale(70%) brightness(70%);
}

.country-close {
    color: #ff4500;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.country-close:hover,
.country-close:focus {
    color: #ffffff;
    text-decoration: none;
}

.stat-category {
    margin-bottom: 15px;
}

.stat-category h3 {
    color: #ff4500;
    border-bottom: 2px solid #ff4500;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 3px;
    background-color: rgba(27,31,36,0.9);
    color: #d7d7d7;
    border: 1px solid #2a2f36;
}

.ai-commentary-panel {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27,31,36,0.96);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 100;
    width: 540px;
    max-height: 140px;
    overflow-y: auto;
    color: #d7d7d7;
    text-align: center;
    border: 1px solid #2a2f36;
}

.ai-commentary-panel h3 {
    color: #c6a15b;
    border-bottom: 2px solid #3a3f46;
}

.commentary-text {
    font-style: italic;
    line-height: 1.5;
    color: #f0f0f0;
    font-size: 15px;
    font-weight: 500;
    animation: fadeIn 0.5s ease;
    text-align: justify;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ballistic-missile-trail {
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px currentColor);
}

.ballistic-missile-warhead {
    animation: none;
}

@keyframes missile-glow {
    0% { r: 4; }
    100% { r: 5; }
}

.toggle-panel {
    margin-top: 8px;
    padding: 8px;
    background: rgba(27,31,36,0.96);
    border: 1px solid #2a2f36;
    border-radius: 8px;
    font-size: 12px;
}

.toggle-panel label { display: block; margin: 4px 0; }

.panel-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(198,161,91,0.06);
    border: 1px solid rgba(198,161,91,0.12);
    color: #c6a15b;
    cursor: pointer;
    font-size: 22px;
    padding: 6px 10px;
    border-radius: 6px;
    line-height: 1;
    width: auto;
    height: auto;
    transition: transform 0.12s ease, background 0.12s ease;
}

.panel-toggle:hover {
    transform: scale(1.06);
    background: rgba(198,161,91,0.12);
}

.collapsed .panel-body { display: none; }

.main-menu {
    position: fixed;
    inset: 0;
    background: rgba(18,20,23,0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #d7d7d7;
}
.main-menu-content {
    background: #14171a;
    padding: 40px;
    border: 1px solid #2a2f36;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    text-align: center;
    width: 420px;
    font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    backdrop-filter: blur(8px);
    animation: pop 220ms ease-out;
}
.main-menu h1 { margin: 0 0 8px; font-weight: 700; }
.subtitle { 
    color: #bbbbbb; 
}
.menu-buttons button {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #3a3f46;
    background: #2a2f36;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.menu-buttons button:hover { transform: translateY(-1px); opacity: 0.95; }
.menu-buttons button:disabled { opacity: 0.5; cursor: not-allowed; }
.menu-info { margin-top: 12px; font-size: 12px; color: #666; }
.version-badge {
    display: inline-block; margin: 6px 0 14px; padding: 2px 8px;
    font-size: 12px; border: 1px solid #3a3f46; border-radius: 999px;
    color: #c6a15b; background: rgba(198,161,91,0.06);
}
.menu-hotkeys { margin-top: 12px; font-size: 12px; color: #9aa0a6; text-align: left; }
.menu-hotkeys code { background:#1d2126; padding:2px 6px; border-radius:4px; border:1px solid #2a2f36; }
@keyframes pop { from { transform: translateY(6px) scale(0.98); opacity: 0; } to { transform:none; opacity:1; } }

.world-news-container {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2500;
    pointer-events: none;
}
.world-news-container.dock-right {
    position: fixed;
    top: 10px;
    right: 10px;
    left: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2500;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    pointer-events: none;
}
.world-news-container .wn-window {
    width: min(380px, 90vw);
    pointer-events: auto;
}

.world-news-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wn-window {
    width: min(640px, 90vw);
    background: #faf7ef;
    border: 1px solid #b9b3a4;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    padding: 18px;
    color: #222;
    user-select: none;
    cursor: move;
}

.wn-header {
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid #cfc7b6;
    padding-bottom: 8px;
    margin-bottom: 12px;
    color: #111;
}

.wn-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border: 1px solid #cfc7b6;
    border-radius: 4px;
    background: #e9e4d8;
}

.wn-headline {
    font-weight: 700;
    text-align: center;
    margin: 12px 0 6px;
    font-size: 18px;
    color: #111;
}

.wn-body {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5efe2;
    border: 1px solid #e0d8c8;
    border-radius: 4px;
    padding: 10px;
}

.wn-button {
    display: block;
    margin: 12px auto 0;
    background: #2a2f36;
    color: #fff;
    border: 1px solid #3a3f46;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
}

.ai-image-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    z-index: 3000;
    font-weight: 600;
}

.country-indicator {
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.country-indicator .indicator-circle {
    stroke: rgba(0,0,0,0.5);
    stroke-width: 1px;
}

.country-indicator .indicator-text {
    font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 9px;
    text-anchor: middle;
    dominant-baseline: central;
}

.wn-window.mini {
    width: 280px;
    padding: 10px;
    cursor: default;
    user-select: none;
}
.wn-window.mini .wn-header { font-size: 13px; margin-bottom: 6px; }
.wn-window.mini .wn-image { height: 80px; }
.wn-window.mini .wn-headline { font-size: 14px; margin: 8px 0 4px; }
.wn-window.mini .wn-body { 
    font-size: 12px; 
    max-height: 68px; 
    overflow: hidden; 
}

#spectator-toggle {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3000;
    padding: 8px 14px;
    background: #14171a;
    color: #fff;
    border: 1px solid #3a3f46;
    border-radius: 6px;
    cursor: pointer;
    font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
#spectator-toggle:hover { background: #2a2f36; }

body.spectator-active .controls,
body.spectator-active #global-stats,
body.spectator-active #date-display,
body.spectator-active #news-panel,
body.spectator-active #stats-panel,
body.spectator-active #ai-commentary,
body.spectator-active #world-news-modal,
body.spectator-active #world-news-container,
body.spectator-active .main-menu,
body.spectator-active .welcome-modal,
body.spectator-active .tooltip,
body.spectator-active .panel-toggle {
    display: none !important;
}

body.spectator-active .screen-darkener,
body.spectator-active .ai-image-loading {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.control-panel {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(27,31,36,0.96);
    border: 1px solid #2a2f36;
    border-radius: 10px;
    padding: 12px;
    z-index: 120;
    width: 240px;
    color: #d7d7d7;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    font-size: 13px;
}
.control-panel .cp-title { font-weight: 700; margin-bottom: 8px; color: #c6a15b; }
.control-panel .cp-actions button {
    width: 100%;
    margin: 4px 0;
    padding: 8px;
    background: #2a2f36;
    color: #fff;
    border: 1px solid #3a3f46;
    border-radius: 6px;
    cursor: pointer;
}
.control-panel .cp-actions button:hover { background: #c6a15b; color: #111; }
.control-panel .cp-hint { margin-top: 6px; color: #9aa0a6; font-size: 11px; }

body.spectator-active .control-panel {
    display: none !important;
}

.country-label {
    pointer-events: none;
    fill: #e6e6e6;
    stroke: rgba(0,0,0,0.5);
    stroke-width: 0.4px;
    paint-order: stroke fill;
    font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: central;
    opacity: 0.4;
}

.settings-form {
    display: grid; gap: 10px; text-align: left; margin-top: 10px;
}
.settings-form label { display:none; }
.settings-form[data-active="sound"] label[data-group="sound"],
.settings-form[data-active="visual"] label[data-group="visual"],
.settings-form[data-active="ai"] label[data-group="ai"],
.settings-form[data-active="events"] label[data-group="events"] { display:block; }

/* === Visual Revamp Overrides === */

/* Subtle textured background and smoother typography */
body {
    background:
        radial-gradient(circle at 0% 0%, rgba(255,255,255,0.02), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(255,255,255,0.02), transparent 55%),
        #070809;
    color: #e3e4e6;
    letter-spacing: 0.01em;
}

/* Darker, cleaner ocean feel */
svg {
    background-color: #05070a;
}

/* Panel surfaces: glassy cards */
.controls,
.global-stats,
.news-panel,
.stats-panel,
.country-panel,
.ai-commentary-panel,
.control-panel,
.country-modal-content,
.modal-content,
.main-menu-content {
    background: radial-gradient(circle at top left, rgba(255,255,255,0.06), transparent 55%),
                rgba(13,15,18,0.96);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow:
        0 16px 40px rgba(0,0,0,0.6),
        0 0 0 1px rgba(0,0,0,0.5);
}

/* Headings with stronger hierarchy */
.global-stats h3,
.news-panel h3,
.stats-panel h3,
.ai-commentary-panel h3,
.main-menu h1 {
    color: #f0e3c0;
    border-bottom-color: rgba(246,209,123,0.35);
}

/* Unified button styling */
button,
.menu-buttons button,
.war-btn,
.alliance-btn,
#spectator-toggle,
.wn-button,
.control-panel .cp-actions button {
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 55%),
                #151820;
    color: #f6f6f6;
    padding: 8px 14px;
    font-size: 13px;
    transition:
        background 0.18s ease,
        transform 0.1s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

button:hover,
.menu-buttons button:hover,
.war-btn:hover,
.alliance-btn:hover,
#spectator-toggle:hover,
.wn-button:hover,
.control-panel .cp-actions button:hover {
    background: radial-gradient(circle at top left, rgba(255,255,255,0.12), transparent 55%),
                #222732;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.6);
    border-color: rgba(246,209,123,0.55);
    color: #fdf8e8;
}

/* Danger / primary accents */
.war-btn {
    background: radial-gradient(circle at top left, rgba(255,120,80,0.18), transparent 60%),
                #3b1210;
    border-color: rgba(255,120,80,0.8);
}
.war-btn:hover {
    background: radial-gradient(circle at top left, rgba(255,120,80,0.24), transparent 60%),
                #4b1613;
}

.alliance-btn {
    background: radial-gradient(circle at top left, rgba(0,180,255,0.16), transparent 60%),
                #082033;
    border-color: rgba(0,180,255,0.8);
}

/* Top-right speed controls as compact pill group */
.speed-controls {
    border-top-color: rgba(255,255,255,0.08);
    font-size: 12px;
    opacity: 0.9;
}
.speed-controls button {
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(12,16,22,0.9);
}
.speed-controls button.active {
    background: linear-gradient(135deg, #f6d17b, #f3b760);
    color: #111;
}

/* Tooltip refinement */
.tooltip {
    background: rgba(7,9,13,0.96);
    border-radius: 8px;
    border-color: rgba(255,255,255,0.06);
    box-shadow:
        0 14px 32px rgba(0,0,0,0.75),
        0 0 0 1px rgba(0,0,0,0.6);
    font-size: 13px;
}

/* News card polish */
.news-item {
    border-bottom-color: rgba(246,209,123,0.28);
}
.pinned-news-item {
    background: radial-gradient(circle at top left, rgba(246,209,123,0.16), transparent 60%),
                rgba(24,19,8,0.96);
    border-color: rgba(246,209,123,0.6);
    color: #fdf2cf;
}

/* World News window: cleaner newspaper look */
.wn-window {
    background: #faf5e6;
    border-radius: 10px;
    border: 1px solid #c3b89e;
    box-shadow:
        0 16px 40px rgba(0,0,0,0.65),
        0 0 0 1px rgba(0,0,0,0.4);
}
.wn-header {
    letter-spacing: 0.08em;
}
.wn-body {
    background: #f7f0dd;
}

/* Map countries & labels */
.country {
    stroke-width: 0.5px;
    stroke: rgba(0,0,0,0.65);
}

.country-0 {
    fill: #4e5b65;
}
.country-1 {
    fill: #8c9c4f;
}
.country-2 {
    fill: #d8b24a;
}
.country-3 {
    fill: #b43b34;
}
.country-4 {
    fill: #5c2323;
}
.country-5 {
    fill: #262626 !important;
}
.country-6 {
    fill: #020202;
}

.country-label {
    fill: #f7f7f7;
    stroke: rgba(0,0,0,0.8);
    stroke-width: 0.45px;
    text-shadow: 0 0 4px rgba(0,0,0,0.7);
}

/* Status badges */
.country-indicator .indicator-circle {
    fill: rgba(7,9,13,0.96);
    stroke: rgba(0,0,0,0.7);
    stroke-width: 1px;
}
.country-indicator .indicator-text {
    font-size: 10px;
}

/* Attack & missile visuals slightly brighter */
.attack-line {
    stroke-opacity: 0.9 !important;
}
.missile-line,
.ballistic-missile-trail {
    filter: drop-shadow(0 0 6px rgba(255,214,120,0.7));
}

/* Screen darkener smoother */
.screen-darkener {
    background: radial-gradient(circle at 50% 40%, rgba(0,0,0,0.1), rgba(0,0,0,0.75));
}

/* Main menu subtle lift */
.main-menu-content {
    transform-origin: center;
}

/* Spectator toggle refinement */
#spectator-toggle {
    background: rgba(10,12,15,0.96);
    border-radius: 999px 0 0 999px;
}

/* Control panel alignment tweak */
.control-panel {
    border-radius: 12px;
}

/* AI commentary readability */
.commentary-text {
    color: #fafafa;
    line-height: 1.55;
}